package com.xuecheng.media.agent;


import com.xuecheng.api.content.model.dto.CoursePubDTO;
import com.xuecheng.api.content.model.dto.TeachplanMediaDTO;
import com.xuecheng.common.constant.XcFeignServiceNameList;
import com.xuecheng.common.domain.response.RestResponse;
import com.xuecheng.media.agent.hystrix.ContentApiAgentFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * Created on 2021/04/05/19:43 周一
 *
 * @author Lantin
 */

@FeignClient(value = XcFeignServiceNameList.XC_CONTENT_SERVICE, fallbackFactory = ContentApiAgentFallbackFactory.class)
public interface ContentApiAgent {


    @GetMapping("content/l/teachplan/media/{mediaId}")
    RestResponse<List<TeachplanMediaDTO>> getTeachplanMediaById(@PathVariable Long mediaId);

    @GetMapping("content/l/course-pub/{coursePubId}")
    RestResponse<CoursePubDTO> getCoursePubById(@PathVariable Long coursePubId);

    @GetMapping("content/l/course/pub/{courseId}")
    RestResponse<CoursePubDTO> getCoursePubByCourseId(@PathVariable Long courseId);

}
